﻿/*
#------------------------------------------------------------------------------
#-- Program Name:	[dbo].[fnMSX_has_access]
#-- Purpose:		If the columns checked within are all NULL, that means
#--					the inventory process was unable to query service status
#--					(via WMI)
#--	Last Update:	07/31/2012
#--					For a complete history - please review comments in Version
#--					Control.
#------------------------------------------------------------------------------
*/
CREATE FUNCTION [dbo].[fnMSX_has_access]
(
	@sql_service			varchar(255),
	@agent_service			varchar(255),
	@sql_start_mode			varchar(10),
	@sql_state				varchar(20)
)
RETURNS bit
AS
BEGIN
	RETURN CAST(CASE	WHEN @sql_service IS NULL 
							AND @agent_service IS NULL 
							AND @sql_start_mode IS NULL 
							AND @sql_state IS NULL 
							THEN 0
						ELSE 1
				END as bit)
END
